#ifndef LISTWIDGET_H
#define LISTWIDGET_H

#include <QWidget>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QLabel>
#include <QPushButton>
#include <QStackedWidget>
#include <QThread>
#include "loadanimation.h"

#include "timelineview.h"

class MobileFileWidget : public QWidget
{
    Q_OBJECT
public:
    MobileFileWidget(int text, QWidget *parent = nullptr);
    ~MobileFileWidget();

    enum ALL_FILE_LIST_TYPE {QQPICTURE, QQVIDEO, QQMUSIC, QQDOCUMENT, WECHATPICTURE,
                             WECHATVIDEO, WECHATMUSIC, WECHATDOCUMENT,
                             PICTURE, VIDEO, MUSIC, DOCUMENT, WECHAT, QQ, HOMEPAGE};
    void showLoadWin();
    //模式切换
    void setMode(QListView::ViewMode mode);
    //设置图片项或者视频项的数据
    void setTimeLineData(const QList<FileInfo> &listStruct);
    //设置音乐项的数据
    void setMusicData(const QList<FileInfo> &listStruct);
    //设置文档项的数据
    void setDocumenData(const QList<FileInfo> &listStruct);
    // 设置缩略图
    void setThumbanil(QString fileName);

private Q_SLOTS:
    void slotModeButtonClicked();
Q_SIGNALS:
    void sigShowMobileFileListWidget();

    void sigInitFinish();

    void sigShowCopyButtonWidget();
    void sigHideCopyToComputerWidget();
    void sigSelectDataList(const QList<FileInfo> &fileList);
    void sigSelectAllDataList(const QList<FileInfo> &fileList);
    void sigShowMobileFileSecondWidget(int currentIndexPath);
    void sigUpdateClicked(int);
    void sigModeChange(QListView::ViewMode);
    void sigMenuFilePath(QString filePath);

private:
    TimeLineView *m_timeLineView = nullptr;
    QPushButton *m_modeButton = nullptr;
    QStackedWidget *m_stackedWin = nullptr;
    LoadAnimation *m_loadAnimation = nullptr;
    QListView::ViewMode m_mode = QListView::IconMode;
    int m_text;

private:
    void initUI();
public Q_SLOTS:
};

#endif // LISTWIDGET_H
